package com.wnxy.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.Pattern;

/**
 * @PackgeName: com.yeheng.entity
 * @ClassName: Emp
 * @Author: YH
 * Date: 2020/12/31 22:20
 * project name: homework1
 * @Version:
 * @Description:
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Emp {

    private Integer eid;

    @Pattern(regexp = "[\u4e00-\u9fa5]{2,4}",message = "名字必须2到4位哦")
    private String ename;

    @Min(value = 6,message = "年龄不能小于6岁")
    private Integer age;

    @Valid
    private Dept dept;
}
